package com.xiaofan.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author 晓帆
 * @version 1.0
 **/
@Configuration
public class MyDBConfig {
    @Value("${db.Driver}")
    String Driver;
    @Value("${db.url}")
    String url;
    @Value("${db.username}")
    String username;
    @Value("${db.password}")
    String password;
    @Bean
    public DruidDataSource get(){
        DruidDataSource dataSource = new DruidDataSource();
        return  dataSource;
    }
}
